package com.hello.sky.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hello.sky.annotation.AutoFill;
import com.hello.sky.enmu.OperationType;
import com.hello.sky.model.entity.Setmeal;
import com.hello.sky.model.entity.SetmealDish;
import com.hello.sky.model.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 套餐菜品关系 Mapper 接口
 * </p>
 *
 * @author D
 */
@Mapper
public interface SetmealDishMapper extends BaseMapper<SetmealDish> {

    List<Long> getSetmealIdsByDishIds(@Param("ids") List<Long> ids);

    @AutoFill(OperationType.INSERT)
    void addBatch(@Param("dishList") List<SetmealDish> setmealDishList);

    List<SetmealVO> getBySetmealIds(@Param("ids") List<Long> ids);

    void delBySetmealId(@Param("setmealIds") Long... setmealIds);

    List<SetmealDish> selectByDishId(@Param("id") Long id);

    Integer getDisableDishBySetmealId(@Param("id") Long id, @Param("status") Integer status);
}
